package com.framework.window;

import com.framework.R;

import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.FrameLayout;

public class FWWindowAcitvity extends Activity {
	ProgressDialog  mDialog ;
	ProgressDialog d1;
	ProgressDialog d2;
	String TAG = "com.framework.window";
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		View view = LayoutInflater.from(this).inflate(R.layout.window_root_acitivity, null);
		setContentView(view);
		Button button = (Button) findViewById(R.id.button);
		mDialog =new ProgressDialog(this);
		mDialog.setProgress(ProgressDialog.STYLE_SPINNER);
		mDialog.setMessage("程序加载中,请售后。。。。。");
		Window mwindow = mDialog.getWindow();
		WindowManager.LayoutParams lp=mwindow.getAttributes(); 
		lp.x=0; 
		lp.y=100; 
		mwindow.setAttributes(lp); 
		d1 = new ProgressDialog(this);
		d1.setMessage("I am 1");
		d1.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
		Window w1 = d1.getWindow();
		WindowManager.LayoutParams wl1 = w1.getAttributes();
		wl1.x = 0;
		wl1.y=-100;
		w1.setAttributes(wl1);
		/**2**/
		d2 = new ProgressDialog(this);
		d2.setProgressStyle(ProgressDialog.STYLE_SPINNER);
		d2.setMessage("I am 2");
		Window w2 = d2.getWindow();
		WindowManager.LayoutParams wl2 = w2.getAttributes();
		wl2.x = 0;
		wl2.y=120;
		w2.setAttributes(wl2);
		FrameLayout layout = new FrameLayout(this);
		Log.d(TAG,"code1==="+view.hashCode());
		Log.d(TAG,"code2===="+button.getParent().hashCode());
		
		
	}
	
	public void showDialog(View view){
		mDialog.show();
		d1.show();
		d2.show();
		
	}
	public void hideDialog(View view){
		mDialog.dismiss();
		d1.dismiss();
		d2.dismiss();
		
	}
	public void lftMoveDialog(View view){
		
	}
	public void upMoveDialog(View view){
		
	}
	
}
